/***************************************************************************
 *   Copyright (C) 2009 by Marcin Swiechowicz   *
 *   marcin.swiechowicz@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef KDCMOVIE_H
#define KDCMOVIE_H

#include <kdcnamespace.h>
#include "kdcmoviemetadata.h"
#include "kdcsubtitle.h"
#include "kdcvideo.h"
#include "kdcaudio.h"
#include "kdcchapter.h"

#include <QString>

class KDCDisc;

class KDCMovie : public KDCObject
{
public:
	KDCMovie( KDCMovieMetaData *aMovieMetaData,  KDCObject *aParent = 0 );
	~KDCMovie();

	void copySettings( const KDCMovie& aMovie );
	KDCMovieMetaData* metaData() const;
	KDCVideo* video() const;
	QList<KDCAudio*> audio() const;
	QList<KDCSubtitle*> subtitle() const;
	KDCChapter* chapter() const;
	KDCSubtitle* subtitles() const;
	
	void addSubMovie( KDCMovie *aMovie );
	void removeSubMovie( int aIndex );
	void moveSubMovie( int aFrom, int aTo );
	const QList<KDCMovie*>& subMovies() const;

	KDC::VideoFormat videoFormat() const;
	void setVideoFormat( KDC::VideoFormat aVideoFormat );
	void setFps( double aFps );
	double fps() const;

	QString outputName() const;
	void setOutputName( const QString& aName );

	quint64 size() const;
	int length() const;

	bool operator!=( const KDCMovie& aMovie );
	
	KIcon icon() const;
	QString title() const;
protected:
	void checkSubtitles();
private:
	friend class KDCDisc;
	KDCMovieMetaData *pMovieMetaData;
	KDC::VideoFormat pVideoFormat;
	QString pOutputName;
	QList<KDCAudio*> pAudio;
	KDCSubtitle *pSubtitles;
	KDCVideo* pVideo;
	KDCChapter* pChapter;
	double pFps;
	QList<KDCMovie*> pSubMovies;
};
#endif
